Skip to content

Conversation

@cfsmp3
Copy link
Contributor

@cfsmp3 cfsmp3 commented Feb 1, 2026

Summary

  • Fixes issue where tests would wait indefinitely (or up to 3 hours) for artifacts that will never be created
  • Now checks upfront if the workflow will run by comparing commit's changed files against the workflow's path filters
  • If no files match the path filters, the test is immediately marked as failed since the build will never happen

Changes

New functions in mod_ci/controllers.py:

  1. _get_workflow_path_filters() - Fetches and parses workflow YAML to extract path filters

    • Caches results for 1 hour to reduce API calls
    • Extracts from on.push.paths and on.pull_request.paths
  2. _will_workflow_run_for_commit() - Checks if commit files match workflow path filters

    • Returns True (will run), False (won't run), or None (can't determine)
  3. Modified _diagnose_missing_artifact() - Checks path filters first before other diagnostics

Flow:

Commit pushed → Test queued → Artifact not found →
  1. Check path filters → No match → FAIL immediately (not retryable)
  2. Check workflow run → In progress → Retry later
  3. Check commit age → > 3 hours → FAIL (not retryable)

Test plan

  • Added unit tests for path filter matching
  • Tests cover: matching files, non-matching docs, no filters, subdirectory patterns
  • Deploy to staging and verify with a docs-only commit

🤖 Generated with Claude Code

Instead of waiting up to 3 hours for artifacts that will never be created,
we now check upfront if the workflow will run by:

1. Fetching the workflow YAML from the repository
2. Parsing the path filters (on.push.paths, on.pull_request.paths)
3. Comparing commit's changed files against the filters

If no files match the path filters, the test is immediately marked as
failed (not retryable) since the build workflow will never run.

This prevents the queue from being blocked by commits that only change
documentation or other non-code files.

Also includes:
- 3-hour timeout for commits with no workflow run (fallback)
- Workflow filter cache (1 hour TTL) to reduce API calls
- Comprehensive tests for path filter matching

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
cfsmp3 and others added 2 commits January 31, 2026 18:08
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 1, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants